--- import { type CollectionEntry, getCollection, render } from "astro:content"; import blogPostSchema from "../../utils/schemas/blogPostSchema"; import breadcrumbSchema from "../../utils/schemas/breadcrumbSchema"; import Comments from "../../components/Comments.astro"; import dayjs from "dayjs"; import Layout from "../../layouts/BaseLayout.astro"; import personSchema from "../../utils/schemas/personSchema"; import websiteSchema from "../../utils/schemas/websiteSchema"; import { config } from "../../config"; type Props = CollectionEntry<"blog">; export async function getStaticPaths() { const posts = await getCollection("blog", ({ data }) => { return data.draft !== true; }); return posts.map((post) => ({ params: { slug: post.id }, props: post, })); } const post = Astro.props; const { Content, remarkPluginFrontmatter } = await render(post); const description = post.data.description; const isBasedOn = post.data.basedOn; const lang = post.data.lang; const preview = `/images/preview/${post.id}.png`; const slug = post.id; const title = post.data.title; const dateModified = post.data.dateModified?.toISOString(); const datePublished = post.data.datePublished.toISOString(); const formattedDate = dayjs(post.data.datePublished.toString()).format("MMMM DD, YYYY"); const siteUrl = new URL("/", Astro.site).toString(); const schema = [ websiteSchema({ siteUrl, name: config.og.website, description, lang }), personSchema({ siteUrl }), blogPostSchema({ siteUrl, dateModified, datePublished, description, isBasedOn, lang, preview, slug, title, }), breadcrumbSchema({ siteUrl, items: [ { name: "Home", url: "/" }, { name: "Blog", url: "/blog/" }, { name: title, url: `/blog/${slug}` }, ], }), ]; ---

{title}

Posted  •  {remarkPluginFrontmatter.minutesRead}